package ch06;

class _14_MemberCall {
	int iv = 10;
	static int cv = 20;

	int iv2 = cv;
	// static int cv2 = iv; // error: this.iv
	static int cv2 = new _14_MemberCall().iv;
	
	static void staticMethod1() {
		System.out.println(cv);
		// System.out.println(iv); // error
		_14_MemberCall c = new _14_MemberCall();
		System.out.println(c.iv);
	}

	void instanceMethod1() {
		System.out.println(cv);
		System.out.println(iv);
	}

	static void staticMethod2() {
		staticMethod1();
		// instanceMethod1(); // error
		_14_MemberCall c = new _14_MemberCall();
		c.instanceMethod1();
	}

	void instanceMethod2() {
		staticMethod1();
		instanceMethod1();
	}
}